﻿
var Bag = {};
// ie 判断不能加载
Bag.Init = function () {
    if (window.localStorage)
        return;
}

//设置地区COUNTRY,CITY,DESTINATION
Bag.setRegion = function (key, id, name) {
    var areaitem = id + "," + name;
    //添加地区标识
    window.localStorage.setItem(key, areaitem);
}

Bag.getRegion = function (key) {
    var item = localStorage.getItem(key);
    var area = { id: "", name: "" };
    if (item == null) {
        return area;
    }
    var items = item.split(',');

    area.id = items[0];
    area.name = items[1]
    return area;

}

//判断是否可以添加
Bag.IsAdd = function (key) {
    var areaItem = localStorage.getItem(key);
    if (areaItem == null) {
        return true;
    }

    return false;
}
